/**
 *calsse responsavel pela gerencia do jogo ela é quem inicia a phase e o game
 */
/**
 *
 */
import corejuliano.*; 
import util.*;
 
class corejuliano.GameManager
{
	private var activePhase:Phase
	private static var instance:GameManager;
	
	static var UPDATE_LOGIC:String = "update_logic";
	static var UPDATE_SCREEN:String = "update_screen";
	static var NORTH:Number = 90;
	static var EAST:Number = 0;
	static var SOUTH:Number = 270;
	static var WEST:Number = 180;
	static var NORTHEAST:Number = 135; 	
	static var SOUTHEAST:Number = 225;
	static var NORTHWEST:Number = 45;
	static var SOUTHWEST:Number = 315;	
	
	/*
nordeste
sudeste
noroeste
sudoeste
		
Northeast
Southeast
Northwest
Southwest
	*/
	
	private var counterPhase:Number = 1;
	
	public function GameManager()
	{
		
	}
	
	static function getInstance():GameManager
	{
		if(instance == undefined)		
			instance = new GameManager();
			
		return instance;
	}
	
	public function start():Void
	{
		activePhase.start();
		_root.onEnterFrame = Delegate.create(this, run);
	}
	
	public function run():Void
	{
		activePhase.updateLogic();
		activePhase.updateScreen();
	}

	public function getActivePhase():Phase
	{
		return activePhase;
	}

	public function setActivePhase(activePhase:Phase):Void
	{
		this.activePhase = activePhase;
	}
	
	public function restart():Void
	{
		
	}
	
	public function nextPhase():Void
	{
		
	}
	
	public function toString():String
	{
		return "corejuliano.GameManager";
	}

}